<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>意见反馈</title>
    <link rel="shortcut icon" href="$request.getContextPath()/resources/cws/images/logo.ico" />
    <link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="$request.getContextPath()/resources/cws/portal/home/css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <link href="$request.getContextPath()/resources/cws/portal/home/css/slider.css" rel="stylesheet" type="text/css" media="all"/>
    <link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/layui/css/layui.css">

    <script type="text/javascript" src="$request.getContextPath()/resources/cws/portal/home/js/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="$request.getContextPath()/resources/cws/portal/home/js/jquery.nivo.slider.js"></script>
    <script type="text/javascript" src="$request.getContextPath()/resources/layui/layui.js"></script>
    <script type="text/javascript" src="$request.getContextPath()/resources/layui/lay/modules/element.js"></script>
    <script type="text/javascript">
        $(window).load(function() {
            $('#slider').nivoSlider();
        });
        $(function(){
            layui.use(['form', 'layedit', 'laydate'], function() {
                var form = layui.form(), layer = layui.layer, layedit = layui.layedit, laydate = layui.laydate;
                var remarkIndex=layedit.build('remark',{
                    tool: [
                        'strong' //加粗
                        ,'italic' //斜体
                        ,'underline' //下划线
                        ,'|' //分割线
                        ,'left' //左对齐
                        ,'center' //居中对齐
                        ,'right' //右对齐
                    ]
                }); //建立编辑器
                //提交反馈信息
                $("#submitFeedbackButton").click(function(){
                    var userName=$("input[name='userName']").val();
                    var email=$("input[name='email']").val();
                    var phone=$("input[name='phone']").val();
                    if((userName==null||userName=='')&&(email==null||email=='')&&(phone==null||phone=='')){
                        layer.alert("请输入联系方式!");
                        return;
                    }
                    var title=$("input[name='title']").val();
                    if(title==null||title==''){
                        layer.alert("请输入反馈标题!");
                        return;
                    }
                    var remark=layedit.getContent(remarkIndex);
                    if(remark==null||remark==''){
                        layer.alert("请输入反馈内容!");
                        return;
                    }
                    $.post("$request.getContextPath()/official/feedback/add",{userName:userName,userEmail:email,userPhone:phone,title:title,content:remark},function(response){
                        //保存成功 关闭当前页
                        top.layer.msg(response.msg,{
                            icon: 1,
                            skin: 'demo-class',
                            title :'信息',
                            time:2000,
                            area: ['300px', '160px'],
                            end :function(){
                                if(response.code==200){
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭
                                    window.location.href="$request.getContextPath()/portal/home/contact";
                                }
                            }
                        });
                    });
                });
            });
        });
    </script>
</head>
<body>
    <div class="header">
        <div class="header_top">
            <div class="wrap">
                <div class="logo">
                    <a href="$request.getContextPath()/portal/home/index"><img src="$request.getContextPath()/resources/cws/images/logo.png" alt="" /></a>
                </div>
                <div class="menu">
                    <ul>
                        <li><a href="$request.getContextPath()/portal/home/index">首页</a></li>
                        <li><a href="$request.getContextPath()/portal/home/product">产品中心</a></li>
                        <li><a href="$request.getContextPath()/portal/home/service">服务中心</a></li>
                        <li><a href="$request.getContextPath()/portal/home/news">新闻</a></li>
                        <li><a href="$request.getContextPath()/portal/home/function">功能介绍</a></li>
                        <li><a href="$request.getContextPath()/portal/home/about">关于我们</a></li>
                        <li><a href="$request.getContextPath()/portal/home/contact">联系我们</a></li>
                        <div class="clear"></div>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="slider">
            <div class="slider-wrapper theme-default">
                <div id="slider" class="nivoSlider">
                    <img src="$request.getContextPath()/resources/cws/portal/home/images/1.jpg" data-thumb="images/1.jpg" alt="" />
                    <img src="$request.getContextPath()/resources/cws/portal/home/images/2.jpg" data-thumb="images/2.jpg" alt="" />
                    <img src="$request.getContextPath()/resources/cws/portal/home/images/3.jpg" data-thumb="images/3.jpg" alt="" />
                    <img src="$request.getContextPath()/resources/cws/portal/home/images/4.jpg" data-thumb="images/4.jpg" alt="" />
                </div>
            </div>
        </div>
    </div>
    <div class="main">
        <div class="wrap">
            <div class="content2" style="width: 100%;margin: 0 auto;">
                <div class="content-form">
                    <h2  style="font-size: 24px;margin-bottom: 10px;line-height: 30px;margin-left:12%">意见反馈</h2>
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label for="email" class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-8">
                                <input type="text" name="userName" value="" class="form-control" placeholder="请输入姓名">
                            </div>
                            <div class="col-sm-4">
                                <span></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="email" class="col-sm-2 control-label">邮箱</label>
                            <div class="col-sm-8">
                                <input type="email" name="email" value="" class="form-control" placeholder="请输入邮箱">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="phone" class="col-sm-2 control-label">手机号码</label>
                            <div class="col-sm-8">
                                <input type="phone" name="phone" value="" class="form-control" placeholder="请输入手机号码">
                            </div>
                            <div class="col-sm-4">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="title" class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-8">
                                <input type="text" name="title" value="" class="form-control" placeholder="请输入反馈标题">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">反馈描述</label>
                            <div class="col-sm-8">
                                <textarea id="remark" name="remark" class="form-control" placeholder="请输入反馈详细描述"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-5 col-sm-1">
                                <button type="button" id="submitFeedbackButton" class="btn btn-default" style="margin-left: 40px">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    #parse('portal/home/footer.html')
</body>
</html>